home *** CD-ROM | disk | FTP | other *** search
- Mail-merging with Impression and Related Matters
- ================================================
-
- Powerbase is capable of performing direct mail-merging with Impression, the
- document-processor marketed by Computer Concepts. Performing this task
- involves the use of a module called ImpulseII which Computer Concepts have
- placed in the public domain to encourage its adoption as a standard means of
- transferring data between RISC OS applications. The ImpulseII module is
- included in the !System application on the Powerbase distribution disc.
-
- How to merge Powerbase data into an Impression document
- =======================================================
- Although we have called this file 'MailMerge' the process to be described is
- more accurately termed "data-merge" since it is by no means limited to
- merging names and addresses into letters: any kind of textual data from a
- Powerbase application can be merged into any kind of Impression document.
-
- Preparing the Impression document
- ---------------------------------
- It is probably best to create the document without worrying about the merged
- data at first, then insert the necessary commands afterwards.
-
- Wherever you want data from a Powerbase record to appear in the document
- proceed as folllows:-
-
- (1) Place the caret at the point where the data is to be inserted.
-
- (2) Click MENU over the frame, go to the 'Misc' submenu and choose 'Merge
- command...'. A dialogue box will appear.
-
- (3) Type the following:-
-
- :Powerbase GetField NAME
-
- This is on the understanding that your Powerbase record contains a field
- whose tag is NAME and that you want the contents of that field inserting
- into the Impression document at that point. Note the spaces and the initial
- colon. These are essential.
-
- (4) Click on 'Set' or type RETURN. You will see "<Merge>" appear in the
- text.
-
- (5) Repeat for all the other Powerbase fields to be inserted in the
- document. All take the form :Powerbase GetField <tag>. All the data in a
- given document must come from the same database. It might be easiest if
- you open the required database and arrange the desktop so that you can
- see both the record window and the Impression document. Clicking MENU
- over a field makes its tag appear in the second menu item.
-
- (6) Save the the document!
-
- When you look at the document there is nothing to distinguish one merge
- command from another; they all appear as "<Merge>". To check up on what a
- command actually looks like open up the 'Merge command' dialogue box again
- and place the caret at the beginning of the merge command, i.e. immediately
- before the initial "<". The text of the command will then appear in the
- writable icon of the dialogue box.
-
- Merging the data
- ----------------
- (1) Make sure Impression has been "seen" by the filer. Impression doesn't
- need to actually be on the icon-bar at this point but it doesn't matter
- if it is.
-
- (2) Open the Powerbase database.
-
- (3) Drop the Impression document on the record window. If Impression isn't
- already running Powerbase will run it for you. Assuming that the
- document isn't loaded already it will be loaded and displayed. Finally
- Powerbase's 'Data merge' dialogue box will appear. (If the document is
- already loaded Impression will print a message informing you of this.
- When you click on 'OK' the 'Data merge' box appears and you should then
- display the Impression document with 'New view'.)
-
- (4) The 'Data merge' window has a writable icon in which you may enter a
- search formula (see '!Tutorial' and 'Print'). Clicking on 'Merge' or
- typing RETURN then extracts data from the first matching record and
- inserts it in the specified places in the Impression document. If no
- search formula was entered the merged record will be the first.
-
- (5) Buttons are provided for "next", "previous", "first" and "last" record.
- These work just like the corresponding keypad buttons and the Impression
- document displays the merged data in each case.
-
- (6) Clicking on 'Print' will print the Impression document in its displayed
- state, i.e. with the currently merged data. If you select the 'Print
- all' switch then click on 'Merge' a whole series of hard copies will be
- produced, one for each matching record.
-
- (7) Note that when the mouse pointer is moved over the Impression document
- it changes to a large red and blue cross which means that you cannot
- edit the document. Clicking SELECT over it has no effect; the caret
- doesn't appear. If you click on 'Cancel' in the dialogue box (or close
- it by clicking on its 'Close' icon) the merged data is removed from the
- document and normal editing is restored.
-
- Mail-merging with other applications
- ====================================
- Powerbase is able to mail-merge directly with Impression only because both
- programs support Impulse commands. Most other DTP programs and word-
- processors do not recognize such commands and mail-merging with them is
- usually accomplished via a CSV (comma separated values) or similar file.
- You will need to read the wordprocessor manual to find out precisely what
- format the file should have and also the Powerbase documentation on CSV
- files. It should be possible to create a file in whatever format is
- required.
-
- Powerbase as an 'Impulse' server
- ================================
- The following is a description of the Impulse "methods" understood by
- Powerbase, given in the standard format recommended by Computer Concepts.
-
- {powerbase Methods:
- GetPathname
- Selection <string>
- ParseQuery <string>
- GetField <tag>
- GetRecord
- PutFile
- ExpandCode <string>
- GetExpanded <string>
-
- Descriptions:
- GetPathname
-
- Specifies an 'object' i.e. a Powerbase database. If Powerbase has the
- required database open it replies with the full pathname of the object,
- otherwise it returns an error message. Example of use:
-
- :Powerbase.!Elements GetPathname (returns pathname of !Elements)
-
- R6 points to pathname when calling task is decoding reply.
-
- Selection <string>
-
- Tells Powerbase about a field, or group of fields, in which the caller is
- interested. The fields are specified as a list of tags, separated by any
- suitable character (e.g. / or ,). The same separator must appear at the very
- end of the tag-list. Powerbase replies with the maximum data-length of the
- combined fields in the selection. Example of use:
-
- :Powerbase Selection NAME/SYM/Z/
-
- R6 points to a string which gives data-length.
-
- ParseQuery <string>
-
- Informs Powerbase of the criteria to be used in selecting records to
- transmit to the caller. The parameter is a standard Powerbase search
- formula and Powerbase replies with the title which would normally appear
- at the head of one of its printed lists. Example of use:
-
- :Powerbase ParseQuery TYPE=T
-
- R6 points to returned title.
-
- GetField <tag>
-
- Requests from Powerbase the data in the specified field of the next record
- which matches the preceding ParseQuery command.
-
- When Powerbase replies to the GetField command the calling task should
- respond with an ImpulseFetchData, specifying the address and length of the
- buffer to be used, and then wait for an Impulse_receive event (reason code
- &204) before reading the buffer.
-
- GetRecord [<key>]
-
- Sent without a key it requests from Powerbase the next record which matches
- the preceding ParseQuery command. If the primary key of a record in the
- database is appended then Powerbase will return the record corresponding to
- that key. The key must be separated from the GetRecord by a space.
-
- The calling task must follow the procedure described above for GetField.
- Powerbase will transmit the fields specified in the Selection command, using
- the same separator as was used in that command. Receipt of data may be
- followed by another GetRecord command, returning the next matching record
- and so on, a zero-length response signifying that there are no more
- matching records. If using keys to request specific records you should end
- by sending *** as a key to tell Powerbase that the dialogue is finished.
- This command and the one below operate only on Subfile 0 of the Powerbase
- database.
-
- PutRecord
-
- Informs Powerbase that the caller wishes to write a record to the current
- Powerbase database. It should be sent as message type &200. A Selection
- command should have been previously sent to tell Powerbase what fields to
- expect and what separator is to be used. Powerbase will then reply with a
- GetRecord command (reason code &201) which the caller should acknowledge
- with message type &202, specifying the maximum length of the data which will
- be sent. Wait for event &203 which is a request by Powerbase for the caller
- to transmit the data. The caller should then do so with ImpulseTransmitData,
- specifying the buffer address and the length of data being sent. This may be
- immediately followed by another PutRecord.
-
- ExpandCode <string>
-
- Requests the expanded form of a code used in a field linked to a validation
- table. The parameter string consists of the code itself, then a space,
- then the name of the validation table with the column number appended.
- Example of use:
-
- :Powerbase ExpandCode T Group0
-
- GetExpanded <string>
-
- Combines the functions of GetField and ExpandCode, i.e. it requests the
- expanded form of the contents of a specified field. The parameter string is
- similar to that for ExpandCode, except that the field tag is substituted for
- the code.
- Example of use:
-
- :Powerbase GetExpanded GP Group0
-
- }
-